package com.csun.dsms.task;

import com.csun.dsms.service.DsmsScheduleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author chisj chisj@foxmail.com
 * @version 1.0.0
 * @date 2021-09-23 15:56
 * @description: TODO
 */
@Slf4j
@Component
public class ScheduledTaskRunner implements ApplicationRunner {

    @Resource
    private DsmsScheduleService dsmsScheduleService;

    /**
     * 程序启动完毕后,需要自启的任务
     *
     * @param args
     *
     * @throws Exception
     */
    @Override
    public void run(ApplicationArguments args) throws Exception {
        log.info(" >>>>>> init schedule task job start");
        dsmsScheduleService.init();
        log.info(" >>>>>> init schedule task job end");
    }
}
